from django.db import models


# Create your models here.
class phase_data(models.Model):
    """
            双色球开奖表
            描述：记录期号、日期、开奖红篮球，当期销售额，一等奖，二等奖信息，总奖池
        """
    phasenum = models.fields.TextField(verbose_name='期号',max_length=10)
    date = models.fields.TextField(verbose_name='日期',max_length=10)
    red1 = models.fields.IntegerField(verbose_name='红球1')
    red2 = models.fields.IntegerField(verbose_name='红球2')
    red3 = models.fields.IntegerField(verbose_name='红球3')
    red4 = models.fields.IntegerField(verbose_name='红球4')
    red5 = models.fields.IntegerField(verbose_name='红球5')
    red6 = models.fields.IntegerField(verbose_name='红球6')
    blue = models.fields.IntegerField(verbose_name='蓝球')
    jackpot = models.fields.TextField(verbose_name='销售额', max_length=20)
    firstnum = models.fields.TextField(verbose_name='一等奖注数', max_length=20)
    firstprice = models.fields.TextField(verbose_name='一等奖奖金', max_length=20)
    secondnum = models.fields.TextField(verbose_name='二等奖注数', max_length=20)
    secondprice = models.fields.TextField(verbose_name='二等奖奖金', max_length=20)
    totalbet = models.fields.TextField(verbose_name='奖池', max_length=20)

class bet_data(models.Model):
    """
            投注信息表
            描述：投注期数，红篮球，中奖级数，是否中奖，投注倍数
    """

    phasenum = models.fields.TextField(verbose_name='期号', max_length=10)
    red1 = models.fields.IntegerField(verbose_name='红球1')
    red2 = models.fields.IntegerField(verbose_name='红球2')
    red3 = models.fields.IntegerField(verbose_name='红球3')
    red4 = models.fields.IntegerField(verbose_name='红球4')
    red5 = models.fields.IntegerField(verbose_name='红球5')
    red6 = models.fields.IntegerField(verbose_name='红球6')
    blue = models.fields.IntegerField(verbose_name='蓝球')
    bonuslevel = models.fields.TextField(verbose_name='中奖等级', max_length=10, default='等待开奖')  # 从一等将至未中奖
    ischeck = models.fields.BooleanField(verbose_name='是否已检测', default=False)  # 是否检测过该投注是否中奖
    multiple = models.fields.IntegerField(verbose_name='投注倍数', default=1)
    bonusprice = models.fields.TextField(verbose_name='中奖金额', max_length=20, default='0')
    additonal_bet = models.fields.BooleanField(verbose_name='追加投注', default=False)#双色球没有追加投注，暂时保留，默认为false

#奖金计算元数据表
class reward_conditions(models.Model):
    """
                奖励信息表
                描述：奖励等级，投中红球数，投中篮球数，单倍奖金数
        """
    bonuslevel = models.fields.TextField(verbose_name='奖励等级', max_length=10)
    red = models.fields.IntegerField(verbose_name='投中红球数')
    blue = models.fields.IntegerField(verbose_name='投中篮球数')
    single_bonus = models.fields.TextField(verbose_name='单倍奖金数', max_length=10)